package com.ruoyi.system.service.impl;

import java.util.List;

import com.ruoyi.system.domain.ChartData;
import com.ruoyi.system.domain.CustomerCount;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.CustomerMapper;
import com.ruoyi.system.domain.Customer;
import com.ruoyi.system.service.ICustomerService;
import com.ruoyi.common.core.text.Convert;

/**
 * customer 服务层实现
 * 
 * @author ruoyi
 * @date 2019-07-03
 */
@Service
public class CustomerServiceImpl implements ICustomerService 
{
	@Autowired
	private CustomerMapper customerMapper;

	/**
     * 查询customer信息
     * 
     * @param customerId customerID
     * @return customer信息
     */
    @Override
	public Customer selectCustomerById(Integer customerId)
	{
	    return customerMapper.selectCustomerById(customerId);
	}
	
	/**
     * 查询customer列表
     * 
     * @param customer customer信息
     * @return customer集合
     */
	@Override
	public List<Customer> selectCustomerList(Customer customer)
	{
	    return customerMapper.selectCustomerList(customer);
	}
	
    /**
     * 新增customer
     * 
     * @param customer customer信息
     * @return 结果
     */
	@Override
	public int insertCustomer(Customer customer)
	{
	    return customerMapper.insertCustomer(customer);
	}
	
	/**
     * 修改customer
     * 
     * @param customer customer信息
     * @return 结果
     */
	@Override
	public int updateCustomer(Customer customer)
	{
	    return customerMapper.updateCustomer(customer);
	}

	/**
     * 删除customer对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
	@Override
	public int deleteCustomerByIds(String ids)
	{
		return customerMapper.deleteCustomerByIds(Convert.toStrArray(ids));
	}



	/**
	 * 查询customer geader列表
	 *
	 * @param customer customer信息
	 * @return customer集合
	 */
	@Override
	public List<CustomerCount> userGender( )
	{
		return customerMapper.userGender();
	}


	/**
	 * 查询customer geader列表
	 *
	 * @param customer customer信息
	 * @return customer集合
	 */
	@Override
	public List<ChartData> userState( )
	{
		return customerMapper.userState();
	}


}
